//
//  HX_CustomView.m
//  UI12-QQMusic-xib
//
//  Created by 韩旭 on 16/8/20.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "HX_CustomView.h"
@interface HX_CustomView ()
@property (nonatomic, strong) block playBtn;
@property (nonatomic, strong) block2 stopBtn;
@end

@implementation HX_CustomView

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
      
    }
    return self;
}
- (void)playBlockPlayerBtn:(block)playBtn StopBtn:(block2)stopBtn {
        _playBtn = playBtn;
        _stopBtn = stopBtn;
}
- (void)awakeFromNib {
    [self.playerBtn addTarget:self action:@selector(play:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)play:(UIButton *)btn {
    [btn setImage:[UIImage imageNamed:@"player_btn_pause_highlight"] forState:UIControlStateNormal];
    [btn removeTarget:self action:@selector(play:) forControlEvents:UIControlEventTouchUpInside];
    [btn addTarget:self action:@selector(stop:) forControlEvents:UIControlEventTouchUpInside];
    _playBtn(btn);
}
- (void)stop:(UIButton *)btn {
    [btn setImage:[UIImage imageNamed:@"player_btn_play_highlight"] forState:UIControlStateNormal];
    [btn removeTarget:self action:@selector(stop:) forControlEvents:UIControlEventTouchUpInside];
    [btn addTarget:self action:@selector(play:) forControlEvents:UIControlEventTouchUpInside];
    _stopBtn(btn);
}
@end
